fix(nzbdav): lowercase blob ID when constructing blob path#527
Merged
Conversation
nzbdav's C# BlobStore writes blob files using Guid.ToString("N") and
Guid.ToString(), which always emit lowercase hex. The SQLite DB stores
NzbBlobId uppercase (EF Core default TEXT Guid format), so on
case-sensitive filesystems every os.Open failed with "no such file or
directory" and the scan reported total_files: 0.
Normalize the blob ID to lowercase before building the path, and add a
regression test using a real uppercase-hyphenated UUID in the DB and a
lowercase path on disk.
Fixes the "Failed to open blob file" errors during NZBDav import scans.
6736ad9 to
8640258
Compare
…on steps Add `skip_post_import_links` flag on import queue items so nzbdav migration imports don't create per-item symlinks or STRM files — library symlinks are rewritten separately in Phase 2. Surface the 4-step migration workflow (import, backup, verify mount, run migration) at the top of the NZBDav import UI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
Failed to open blob file: no such file or directoryerrors during NZBDav import scans, where the scan reportstotal_files: 0even though the blobs directory is accessible.Root cause
nzbdav's C#
BlobStorewrites blob files usingGuid.ToString("N")andGuid.ToString(), both of which always emit lowercase hex:But EF Core stores the
NzbBlobIdcolumn as uppercase hyphenated text (e.g.0AA2BD24-B90C-4E06-A301-DD0D296AD86C). altmount was passing that DB value directly intofilepath.Join, so on case-sensitive filesystems (Linux ext4, etc.) everyos.Openfailed, and sincecount++only runs on success, the final log showedtotal_files: 0.Change
Normalize the blob ID to lowercase before constructing the filesystem path in
internal/nzbdav/parser.go. Also addTestParser_Parse_Blobs_UppercaseUUIDas a regression test that stores an uppercase UUID in the DB and the lowercase file on disk — the existing tests used 16-char lowercase hex fixtures so they never tripped this bug.Test plan
go test -race ./internal/nzbdav/...— new test passes, existing tests stay green/blobsdirectory and confirm noFailed to open blob fileerrors and a non-zerototal_files